package com.wys.mall.service.controller;

import com.aliyun.oss.OSS;
import com.wys.common.exception.RRException;
import com.wys.common.utils.R;
import com.wys.mall.service.component.SmsComponent;
import com.wys.mall.service.utils.OssUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 短信发送
 *
 * @Package com.wys.mall.service.controller
 * @Author charlin
 * @Version: v1.0
 * @Date 2021-06-1721:41
 * @Copyright: 2021 www.wyscha.com Inc. All rights reserved.
 */
@Controller
@RequestMapping(value = "/sms")
@Slf4j
public class SmsSendController {

    @Autowired
    private SmsComponent smsComponent;


    @GetMapping(value = "/sendCode")
    public R sendCode(@RequestParam("phone") String phone, @RequestParam("code") String code) {
        //发送验证码
        smsComponent.sendCode(phone,code);
        return R.ok();
    }
}
